<?php
  //Genesis Software Manual - Page 12

  $pdf->AddPage();

  //$pdf->Image('./Genesis/Gen-soft/Gsm-05.png',0,0,210 ,297);
  //add_raster($pdf);

  $pdf->SetDrawColor(0,0,0);
  $pdf->SetTextColor(0,0,0);
  $pdf->SetFont('arial','B',10);
  set_text_space(3.9);
 
  $margin = array
  (
    'tab_1' => 40,
    'tab_2' => 46,
    'tab_3' => 55
  );
  
  new_line(28);
    $pdf->Bookmark('II. VDP 315-5313',0,current_line() - 10);
    $pdf->Text($margin['tab_1'],current_line(),'II.');
    $pdf->Text($margin['tab_2'],current_line(),'VDP 315-5313');
    $pdf->SetFont('arial','',10);
    
  new_line(33);
    $pdf->Text($margin['tab_2'],current_line(),'(Video Display Processor)');
  new_line();
  set_text_space(4.4);
  new_line();
    $pdf->Text($margin['tab_2'],current_line(),'The VDP controls screen display. VDP has graphic Modes IV and V, where Mode IV is for');
  new_line();
    $pdf->Text($margin['tab_2'],current_line(),'compatibility with the MASTER SYSTEM and V is for the new MEga drive functions. There');
  new_line();
    $pdf->Text($margin['tab_2'],current_line(),'are no advantages to using Mode IV, so it is assumed that all Mega drive development will');
  new_line();
    $pdf->Text($margin['tab_2'],current_line(),'use Mode V. In mode V, the VDP display has 4 planes: SPRITE, SCROLLA/WINDOW,');
  new_line();
    $pdf->Text($margin['tab_2'],current_line(),'SCROLLB, and BACKGROUND');
    
  $pdf->SetFont('arial','B',10);
  new_line(82);    
    $pdf->Text($margin['tab_3'],current_line(),'GRAPHIC IV MODE (COMPATIBILITY MODE)');
    
  
  //--- Drawing Figure 1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  $pdf->SetFont('arial','',8);
  $pdf->SetFillColor(255,255,255);
    
  $fig_x = $margin['tab_3'];
  $fig_y = current_line() + 8;
    
  //SCROLL and SPRITE window
  $pdf->Rect($fig_x,$fig_y,31,23);
  center_text_white_line($fig_x,$fig_y,31,'SCROLL',8);
    $pdf->Rect($fig_x + 3,$fig_y + 5,31,23,'DF');
    center_text_white_line($fig_x + 3,$fig_y + 5,31,'SPRITE',9);
     
  //Connection lines
  $pdf->Line($fig_x + 31,$fig_y + 2,$fig_x + 45,$fig_y + 2);
  $pdf->Line($fig_x + 34,$fig_y + 11,$fig_x + 45,$fig_y + 11);
   
    
  //PRIORITY CONTROLLER  
  $pdf->Rect($fig_x + 45,$fig_y,29,17);
    $pdf->CenterText($fig_x + 45,$fig_y + 8,'PRIORITY',29);
    $pdf->CenterText($fig_x + 45,$fig_y + 8 + 3.2,'CONTROLLER',29);
     
  //DISPLAY and BACKGROUND
  $pdf->Rect($fig_x + 84,$fig_y - 3,33,29);
    center_text_white_line($fig_x + 84,$fig_y - 3,33,'BACKGROUND',5);
  $pdf->Rect($fig_x + 87,$fig_y,27,23);
    $pdf->CenterText($fig_x + 87,$fig_y + 12,'DISPLAY',27);
    $pdf->SetDrawColor(255,255,255);
    $pdf->Line($fig_x + 84,$fig_y + 3,$fig_x + 84,$fig_y + 10);
    $pdf->SetDrawColor(0,0,0);
   
  //Connection line - drawn later because a white line is draw first in the square of BACKGROUND
  $pdf->Line($fig_x + 45 + 29,$fig_y + 7,$fig_x + 87,$fig_y + 7);



  $pdf->SetFont('arial','B',12);
  new_line(130);
    $pdf->Text($margin['tab_3'],current_line(),'GRAPHIC V MODE (16 BIT MODE)');


  //--- Drawing Figure 2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  $pdf->SetFont('arial','',8);
  $pdf->SetFillColor(255,255,255);
    
  $fig_x = $margin['tab_3'];
  $fig_y = current_line() + 8;
   
  //SCROLL and SPRITE window
  $pdf->Rect($fig_x,$fig_y,31,23);
  center_text_white_line($fig_x,$fig_y,31,'SCROLL B',7);
    $pdf->Rect($fig_x + 3,$fig_y + 5,31,23,'DF');
    center_text_white_line($fig_x + 3,$fig_y + 5,31,'SCROLL A',7);
      $pdf->Rect($fig_x + 3 + 3,$fig_y + 5 + 5 + 2,31,23,'DF');
      center_text_white_line($fig_x + 3 + 3,$fig_y + 5 + 5 + 2,31,'WINDOW',7);
        $pdf->Rect($fig_x + 3 + 3 + 3,$fig_y + 5 + 5 + 5 + 3,31,23,'DF');
        center_text_white_line($fig_x + 3 + 3 + 3,$fig_y + 5 + 5 + 5 + 3,31,'SPRITE',9);
         
  //Connection lines
  $pdf->Line($fig_x + 31    ,$fig_y + 3 ,$fig_x + 48.6,$fig_y + 3);
  $pdf->Line($fig_x + 31 + 3,$fig_y + 9 ,$fig_x + 40,$fig_y + 9);
  $pdf->Line($fig_x + 31 + 6,$fig_y + 16,$fig_x + 40,$fig_y + 16);
  $pdf->Line($fig_x + 31 + 9,$fig_y + 20,$fig_x + 48.6,$fig_y + 20);
   
  //Block left of PRIORITY CONTROLLER
  $pdf->Rect($fig_x + 40,$fig_y + 6,6,11);
  $pdf->Line($fig_x + 40 + 6,$fig_y + 11,$fig_x + 48.6,$fig_y + 11);
   
  //PRIORITY CONTROLLER
  $pdf->Rect($fig_x + 49,$fig_y,29,21);
    $pdf->CenterText($fig_x + 49,$fig_y + 9,'PRIORITY',29);
    $pdf->CenterText($fig_x + 49,$fig_y + 9 + 3.2,'CONTROLLER',29);
   
  //DISPLAY and BACKGROUND
  $pdf->Rect($fig_x + 84,$fig_y - 3,33,29);
    center_text_white_line($fig_x + 84,$fig_y - 3,33,'BACKGROUND',5);
  $pdf->Rect($fig_x + 87,$fig_y,27,23);
    $pdf->CenterText($fig_x + 87,$fig_y + 12,'DISPLAY',27);
    $pdf->SetDrawColor(255,255,255);
    $pdf->Line($fig_x + 84,$fig_y + 3,$fig_x + 84,$fig_y + 10);
    $pdf->SetDrawColor(0,0,0);
   
  //Connection line - drawn later because a white line is draw first in the square of BACKGROUND
  $pdf->Line($fig_x + 45 + 33,$fig_y + 7,$fig_x + 87,$fig_y + 7);
   
   
  add_footer($pdf,'02/20/92','5');
    
//Special functions down here =============================================================================
    
  //This function draws a white line and draws text in the center of X + WIDTH
  function center_text_white_line($x,$y,$width,$text,$correction=1)
  {
    global $pdf;
    $pdf->SetDrawColor(255,255,255);
    $pdf->Line($x + $correction,$y,$x + $width - $correction,$y);
    $pdf->SetDrawColor(0,0,0);
    $pdf->CenterText($x,$y + 1,$text,$width);
  }
    
    
?>
